package com.ztjava.auth.listener;

import com.jfinal.aop.Duang;
import com.jfinal.kit.Ret;
import com.ztjava.auth.service.AuthService;
import com.ztjava.core.bean.sub.MessageBean;
import com.ztjava.plugin.event.EventTag;
import com.ztjava.plugin.event.core.ApplicationListener;
import com.ztjava.plugin.event.core.Listener;
import com.ztjava.plugin.event.core.RequestEvent;
@Listener(enableAsync = true,tag=EventTag.AUTH_MESSAGE)
public class AuthMessageListener implements ApplicationListener<RequestEvent>{
	private static AuthService authService = Duang.duang(AuthService.class);

	@Override
	public Ret onApplicationEvent(RequestEvent event) {
		MessageBean messageBean = (MessageBean)event.getSource();
		authService.insertMessage(messageBean);
		return null;
	}

}
